function quality = estimateNextMoveQuality(newTable, weights, pieces)

qualitySum = 0;
piecesNum = length(pieces);

for piece = pieces
    inputs = formInputs(newTable, piece);
    currentQualities = predictQuality(weights, inputs);
    qualitySum = qualitySum + max(currentQualities);
end

quality = qualitySum / piecesNum;

end

